HTML quick reference

The authoritative source of information on the structure of HTML documents is the IETF HTML 2.0 specification. This document should be available at the following URL:

http://www.w3.org/hypertext/WWW/MarkUp/MarkUp.html

The HTML rules used by HoTMetaL also contain some elements and attributes from the HTML 3.0 specification, as well as some elements and attributes that are supported by the Netscape browser.

This section provides a short summary of the HTML 2.0 elements and the supported extensions. The rules governing the HTML format are quite flexible, and furthermore HoTMetaL will guide you through the document structure: therefore, the approach followed here will not be to enumerate all the possible combinations of elements. Rather, an overview of the structure will be presented, together with a discussion of the different groups of elements (emphasis, links, lists, etc.).

Overview

Block formatting

The major divisions of a document body's structure comprise the following elements:

Character formatting

The following elements are used primarily to add emphasis to inline text:

Line breaks

If you want to force a browser to break the current line in the text, insert a BR element (you can do this by clicking on the BRICON toolbar button). You can't type inside this element: it just causes a line break.

Horizontal lines

To cause the browser to display a horizontal line (rule) in your document, insert an HR element (you can do this by clicking on the HRICON toolbar button). Individual browsers may display lines of different widths and lengths.

List elements

HTML supplies five list elements. With the exception of DL, list elements are composed of one or more LI (list item) elements.

You can nest lists by inserting a UL, OL, etc., inside a list item (LI).

Each list type also has a `compact' version, which will be displayed with less whitespace in a browser.

You can choose a menu lists, directory lists, and all compact lists from the LISTICON (`Other lists')toolbar button.

Link elements

It is normal for HTML documents to contain links to other documents, which can be located anywhere on the Web. These links are provided by URLs (Uniform Resource Locators), which give the location and filename of a document, and the method used to access it.

The following elements represent links to other documents:

Links to a specific location

This topic is covered in an example in the tutorial section.

In general, you can set up a `source' and `target' anchor pair by setting the NAME attribute of the target anchor to `string' and setting the URL of the source anchor to `#string'. This sets up a one-way link. You can set up a two-way link by editing the two anchors so that each one's NAME attribute corresponds to the other's URL. See the section Links to a specific location in the URLs chapter for more information.

`Hot images'

A `hot image' is used like an anchor-when you click on the image, the browser performs an action.

This is very easy to accomplish: you just need to insert an IMG element inside an A element. Both elements will have a URL: the IMG's URL locates the image, and the A's URL locates the file that is retrieved when you click on the image.

Images with hot spots

Sometimes you will see images that have several `hot spots' that you can click on and cause URLs to be accessed. This is done using a image map file, which tells the browser where the hot spots are. To prepare such a file, you'll need other tools besides HoTMetaL; see the section Image maps in the Working with images chapter for more information. You can also retrieve the document `Overview on using Clickable Image Maps' by opening the file faq.html, located in the HoTMetaL installation directory, with a browser and clicking on the appropriate anchor.

Forms

The following elements are used to construct forms that the user can fill in and submit over the Web. When your document is browsed, the browser will generate the appropriate graphical objects.

For more information on forms, see the tutorial on forms. You can also retrieve the document `Information on setting up form functionality' by opening the file faq.html, located in the HoTMetaL installation folder, with a browser and clicking on the appropriate anchor.

`Code' elements

The elements in this section would normally be used in technical manuals or papers.

Netscape and HTML 3.0 extensions

HoTMetaL lets you use the Netscape extensions to HTML 2.0 (for example, the FONT element) and some HTML 3.0 elements. These are available from the markup commands (Insert Element... and Change..., Edit SGML Attributes...) or from the EXTICON (`Extensions to HTML 2.0') toolbar button.

It is important to realize that these extensions are non-standard, are not supported by all browsers (many are supported only by Netscape), and could change at any time. You should also consult the Netscape extensions documentation (see the Netscape home page, http://www.mcom.com) and the HTML 3.0 documentation (see the W3O home page, http://www.w3.org).

The following list describes some common extensions (at the time of this writing). Any attributes that are described should be edited with the Edit SGML Attributes... command. That is, put the insertion point inside the element in question and then choose this command-see also Attributes for more information on attributes.

HTML tables are also supported: see the chapter Tables.